﻿using System.Security.Cryptography;
using System.Text;

namespace Face8280WebSocketServerTest
{
    public class MD5Tool
    {
        public static string Encrypt(byte[] data)
        {
            MD5 md5 = MD5.Create();
            var hash = md5.ComputeHash(data);
            StringBuilder sb = new StringBuilder(32);
            for (int i = 0; i < hash.Length; i++)
            {
                sb.AppendFormat("{0:x2}", hash[i]);
            }
            return sb.ToString();
        }
    }
}
